package baidu;

import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
import javax.servlet.annotation.HandlesTypes;
import java.util.Set;

@HandlesTypes({})
public class ThirdContainerInitializer implements ServletContainerInitializer {
    @Override
    public void onStartup(Set<Class<?>> c, ServletContext ctx) throws ServletException {
        System.out.println("ThirdContainerInitializer被调用了");
        ServletRegistration.Dynamic dynamic = ctx.addServlet("go-servlet", "baidu.servlet.GoServlet");
        dynamic.addMapping("/goServlet");
    }
}
